#!/usr/bin/env bash
# sort an array
a=(f e d c b a)
echo "Original array: ${a[@]}"
a_sorted=($(for i in "${a[@]}"; do
    echo $i;
done | sort))
echo "Sorted array: ${a_sorted[@]}"
